#include "clock.h"
#include <reg52.h>

CLOCK_TYPE g_clock={12,0,0};

void clock_run(CLOCK_TYPE* clock)
{
	if(clock->sec>=59)
	{
		clock->sec=0;
		if(clock->min>=59)
		{
			clock->min=0;
			if(clock->hour>=23)
				clock->hour=0;
			else clock->hour++;
		}					
		else clock->min++;
	}
	else clock->sec++;


}

